#pragma once
#include <string>
#include <thread>
#include "CLComTimer.h"

using namespace std;

class CTimer
{
public:
	CTimer();
	~CTimer();

public:
	void SetCB(PTIMERCALLBACK pcb);
	void SetGapTicks(int nTicks);
    void SetUserData(quint64 UserData);
	void SetState(int* pState);
public:
	void Start();
	void Stop();

	void Reset();

    quint64 GetKey();
private:
	void NotifyChange();

private:
	static void ThreadCount(CTimer* pThis);

private:
	thread*			m_pThread;
    quint64         m_uid;
	PTIMERCALLBACK	m_pcb;
	int				m_nGapTicks;
    quint64         m_UseData;
	int*			m_pState;

	bool			m_bStart;
	bool			m_bThreadRuning;
};

